﻿@model SampleApp.Web.Default.Models.LogOnModel

@{
    ViewBag.Title = "登录";
}

@section head
{
    <link href="@Url.Content("~/Default/Content/css/LogOn.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
}

@section js
{
    <script type="text/javascript">
        function showTip(input) {
            if (!input.value.length) {
                with (input) {
                    //style.fontSize = '12px';
                    style.color = '#888';
                    value = input.title;
                }
            }
            else {
                with (input) {
                    style.color = '#000';
                }
            }
        }

        function getFocus(input) {
            if (input.value == input.title) {
                with (input) {
                    style.fontSize = '';
                    style.color = '';
                    value = '';
                }
            }
        } 
    </script>

    <!--[if IE 6]> 
    <script type="text/javascript"> 
        $(function(){
            $("#ie6").css("display","");
            $("#imgleft").css("display","none");
        });
    </script> 
    <![endif]--> 
}


<div id="LogOn" class="pBoxDiv">
    <div class="left">
        <img id="imgleft" src="@Url.Content(string.Format("~/Default/Content/images/LogOn/user{0}.jpg", new Random().Next(1, 12).ToString("00")))" onload="javascript:ResizeImage(this,400,340)"/>
    </div>
    <div class="right">
        @using (Html.BeginForm()) {
            <div>
                    <h2>登录</h2>
                    <p>请登录后重试刚才的操作</p>
                    @Html.ValidationSummary(true, "登录失败,请重试.")

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <table cellspacing="0" cellpadding="4" border="0">
            <tbody>
                <tr>
                    <td>
                        用户
                    </td>
                     <td>
                        @Html.TextBoxFor(m => m.UserCode, new { @class = "field", title = "", onblur = "showTip(this)", onfocus = "getFocus(this)",style="color:#888;" })
                    </td>
                </tr>
                <tr>
                    <td>
                        密码
                    </td>
                     <td>
                        @Html.PasswordFor(m => m.Password, new { @class = "field" })
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td>
 @*                       @Html.CheckBoxFor(m => m.RememberMe)
                        @Html.LabelFor(m => m.RememberMe)*@
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td>
                        <button class="metro ok" type="submit">
                            <span class="ok-txt">登录</span>
                        </button>
                        @* <button class="metro cancel" type="submit">
                            <span class="cancel-txt">返回</span>
                        </button>*@
                    </td>
                </tr>
            </tbody>
        </table>
                    <div  style="border-top: 1px solid #ECECEC;display:none;">
                        <p>
                            @Html.ActionLink("注册", "Register") 新用户
                        </p>
                    </div>
            </div>
        }
    </div>


</div>
<div class='split'>
</div>
     <div id="ie6" style="display:none;background-color:#FAA;">
        请使用更高版本的IE浏览器或FireFox浏览器,<a href="http://www.firefox.com.cn">从火狐中文官方网站下载</a>
    </div>